package com.hx.vending.service;

import com.hx.vending.bean.Dict;
import com.hx.vending.bean.Equipment;
import com.hx.vending.bean.Model;
import com.hx.vending.bean.entity.EquipmentDentity;
import com.hx.vending.util.Msg;
import org.apache.ibatis.annotations.Param;
import org.springframework.validation.BindingResult;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2018/11/26.
 */
public interface IEquipmentService {

    List<Equipment> selectByFieldId(@Param("fieldId") Integer fieldId);

    List<Equipment> selectByExample(@Param("equipment")Equipment equipment);

    Model selectModelById(Integer eqModelId);

    Equipment selectByPrimary(@Param("equipment") Equipment equipment);

    Integer updateByPrimaryKeySelective(@Param("equipment")Equipment equipment);

    Integer insertSelective(@Param("equipment")Equipment equipment);

    Integer updateByEqipment(@Param("equipment")Equipment equipment);

    List<Dict> selectDictByPid(@Param("pid")Integer pid);

    Msg getEquipmentListByFieldId(Map<String,Object> paramMap);

    /**
     * 查询设备的轮播图轮播视频
     * @param equipmentId
     * @return
     */
    Msg selectEquipmentWheelMessage(String equipmentId);


    /**
     * 保存设备轮播图片
     * @param equipmentId
     * @param pictures
     * @return
     */
    Msg updateEquipmentPicture(String equipmentId, String pictures);

    /**
     * 删除设备轮播图片
     * @param equipmentId
     * @param pictures
     * @return
     */
    Msg deleteEquipmentPicture(String equipmentId, String pictures);

    /**
     * 停用设备
     * @param equipmentId
     * @return
     */
    Msg discontinueEquipment(String equipmentId, String whetherUser);

    /**
     * 替换设备轮播图片
     * @param equipmentId
     * @return
     */
    Msg updateReplaceEquipmentPicture(String equipmentId);

    int deleteEquipmentById(String equipmentId);

    List<EquipmentDentity> selectByExamplePage(String equipmentId, String equipmentType, String userName, Integer equipmentUseCondition,
                                               Integer equipmentState, Integer pageNum);
    Integer selectEquipmentNum(String equipmentId,String equipmentType,String userName,Integer equipmentUseCondition,
                               Integer equipmentState);

    int updateEquipmentVideo(Equipment equipment);

    int updateEquipmentByUserId(Integer userId);

    /**
     * 设备货道测试
     * @param equipmentId    设备id
     * @param trailsId       货道id
     * @return
     */
    Msg equipmentTrailsTest(String equipmentId, Integer trailsId, Integer caseNumber);

    List<Equipment> selectByFieldIds(Integer[] integers);

    /**
     * 查询设备流量卡的信息
     * @param userId             用户id
     * @param equipmentId        设备id（传查当前设备的）
     * @param type               类型0查询最近七天   1查询当月的(默认查最近七天的)
     * @return
     */
    Msg selectEquipmentFlowcard(Integer userId, String equipmentId, Integer type);

    /**
     * 查询物联卡的使用情况（后台查询）
     * @return
     */
    Msg selctFlowcardUserCondition();

    /**
     * Android保存截屏图片
     * @param file
     * @param equipmentId
     * @return
     */
    Msg uploadScreenshotPicture(MultipartFile[] file, String equipmentId);

    /**
     * 请求获取Android截屏图片
     * @param equipmentId
     * @param userId
     * @return
     */
    Msg requestScreenshotPicture(String equipmentId, Integer userId);

    /**
     * 调节设备音量
     * @param equipmentId       设备id
     * @param type              raise/lower
     * @return
     */
    Msg equipmentAdjustVolume(String equipmentId, String type);


    /**
     * 获取设备音量
     * @param equipmentId
     * @return
     */
    Msg selectEquipmentAudio(String equipmentId);

    Msg uploadPhoto(MultipartFile[] file, String equipmentId);

    Msg requestEquipmentCamera(String equipmentId,Integer userId);


    /**
     * 线下支付统计设备余币
     * @param equipmentId
     * @param coins
     * @return
     */
    Msg updateEquipmentCoin(String equipmentId, Integer coins);

    /**
     * 修改设备总余币数
     * @param equipmentId
     * @param coins
     * @return
     */
    Msg updateEquipmentCoinCount(String equipmentId, Integer coins);
}
